<template>
        <ul>
            <li v-for="item in goodsList" :key="item.id" @click="gotoDetails(item.id)">
                <a href="#">
                    <img v-lazy="item.list_pic_url" alt="" />
                </a>
                <p class="van-ellipsis">{{ item.name }}</p>
                <p>{{ item.retail_price | geshi }}</p>
            </li>
        </ul>
</template>

<script>
export default {
  props:["goodsList"],
    data () {
        return {

 
        }
    },
    methods:{
        gotoDetails(id){
            this.$router.push("/details?id="+id)
            // 解决跳转到当前路由时,页面不刷新的问题
            if(this.$route.path=="/details"){
                // 刷新页面
                this.$router.go(0)
            }
        }
    }
}
</script>
 
<style lang = "less" scoped>
 
</style>